<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% 
	String path = request.getContextPath(); //解決跳轉后樣式丟失的問題
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 	
%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
     <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<%=path%>/background/style/resource/Css/style.css" />
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/jquery.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/bootstrap.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/ckform.js"></script>
    <script type="text/javascript" src="<%=path%>/background/style/resource/Js/common.js"></script>

 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form action="#" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">店铺名称</td>
        <td id="sname"></td>
    </tr>
    <tr>
        <td class="tableleft">商家名</td>
        <td id="bname">${user.name }</td>
    </tr>
    <tr>
        <td class="tableleft">开店日期</td>
        <td id="time"></td>
    </tr>
    <tr>
        <td class="tableleft">星级</td>
        <td id="level">5</td>
    </tr>
    <tr>
        <td class="tableleft">类别</td>
         <td id="sort">零食</td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="button" class="btn btn-primary" id="editpwd">修改密码</button>
            <button type="button" class="btn btn-success" id="editMsg">修改店铺信息</button>
        </td>
    </tr>
   
</table>
</form>
${msg}
</body>
</html>
<script>

var url = "/tbpoject/business/";
    $(function () {       
		getStoreMsg();
		$('#editpwd').click(function() {
			window.location.href = "/tbpoject/background/business/editpassword.jsp";
		});
		$('#editMsg').click(function() {
			window.location.href = "/tbpoject/business/getstoremsgtoupdate";
		});
		
		
    });
    
    function getStoreMsg(){
    	$.post(url+"getstoremsg",{},function(msg){
    		var data=$.parseJSON(msg);
    		for (var i = 0; i < data.length; i++) {
    			$('#sname').html(data[i].name);
        		$('#time').html(data[i].time);
        		$('#level').html(data[i].level);
        		$('#sort').html(data[i].sort.name);
			}
    		
    	})
    }
</script>